package com.chenfan.mcn.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author:   tangwei
 * Date:     2021/2/28 13:56
 * Description: 执行单类型
 */
@AllArgsConstructor
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
public enum ExcutionOrderTypeEnum {

    /**
     * 执行单类型
     */
    INSIDE_EXCUTION_ORDER(1, "内部红人执行单"),

    OUTSIDE_EXCUTION_ORDER(2, "外部红人执行单"),

    KOC_EXCUTION_ORDER(3, "KOC红人执行单"),
    ;

    @Getter
    private Integer type;

    @Getter
    private String desc;

    public static ExcutionOrderTypeEnum getByType(Integer type) {
        for (ExcutionOrderTypeEnum value : ExcutionOrderTypeEnum.values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }

    public static boolean isInside(Integer type) {
        return ExcutionOrderTypeEnum.INSIDE_EXCUTION_ORDER.getType().equals(type);
    }
    public static boolean isOutside(Integer type) {
        return ExcutionOrderTypeEnum.OUTSIDE_EXCUTION_ORDER.getType().equals(type) || ExcutionOrderTypeEnum.KOC_EXCUTION_ORDER.getType().equals(type);
    }

}